<?php
    set_time_limit(0);
    define('APP', TRUE);
    require('../modules/loader.php');
    if(!isset($_SESSION['user']) || $_SESSION['user'] != 'GODBLESSUS'){
        header('location:login.php');
        return ;
    }
	require('../modules/comm.php');
    $mod = isset($_REQUEST['mod'])?$_GET['mod']:FALSE;
	$act = isset($_REQUEST['act'])?$_GET['act']:FALSE;
	
	if($mod == FALSE){
		echo 'You wannt do something?';
		return;
	}
	$mod_name = ROOTPATH.'modules/'.$mod.'.php';
	if(file_exists($mod_name) ==TRUE){
		include($mod_name);
		$mod_class = new $mod();
	}else{
		echo 'file not exists: '.$mod_name;
		exit();
	}
	
	if($act == FALSE){
		$mod_class->index();
	}elseif(method_exists($mod_class, $act)){
		$mod_class->$act();
	}else{
		echo 'not found methoda';
	}
	
?>